<?php
declare (strict_types = 1);

namespace app\common\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Cart extends Model
{
    /**
     * 购物车商品的和spu、sku的关系
     */
    public function spu(){
        return $this->hasOne(Goods::class,'id','goods_id');
    }

    /**
     * sku的关系
     * @return \think\model\relation\HasOne
     */
    public function sku(){
        return $this->hasOne(SpecGoods::class,'id','spec_goods_id');
    }
}
